let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n126,
                    i =
                    (this && this.__extends) ||
                    ((_n126 = function n(t, e) {
                            return (_n126 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n126(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        });
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.MilitaryMrg = void 0);
                var r = t('AbsInfo'),
                    a = t('MilitaryCfg'),
                    s = t('AbsObject'),
                    c = t('BattleAttrInfo'),
                    l = t('BagMrg'),
                    u = (function(t) {
                        function e() {
                            var e = t.call(this) || this;
                            return (e._battleAttrInfo = new c.BattleAttrInfo()), e;
                        }
                        return (
                            i(e, t),
                            Object.defineProperty(e, 'ins', {
                                get: function get() {
                                    return null == e._ins && (e._ins = new e()), this._ins;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            (e.prototype.init = function(t) {
                                if (((this._military = {}), t))
                                    for (var e in t) {
                                        for (var o = t[e], n = [], i = 0; i < o.length; i++) {
                                            var r = o[i];
                                            n.push(a.MilitaryCfg.ins.getData(r));
                                        }
                                        this._military[e] = n;
                                    }
                                else
                                    for (var s = 1; s <= 3; s++) {
                                        o = [];
                                        for (var c = 0; c < 3; c++) {
                                            o.push(
                                                a.MilitaryCfg.ins.getDataByTypeAndKindAndLevle(
                                                    s,
                                                    c + 1,
                                                    1
                                                )
                                            );
                                        }
                                        this._military[s] = o;
                                    }
                                l.BagMrg.ins.addCountEvent(
                                        l.BagMrg.GOLD,
                                        this.onGoldChanged,
                                        this
                                    ),
                                    this.onGoldChanged(l.BagMrg.ins.getCount(l.BagMrg.GOLD));
                            }),
                            (e.prototype.getDataByType = function(t) {
                                return this._military[t];
                            }),
                            (e.prototype.upgrade = function(t, e, o) {
                                var n = a.MilitaryCfg.ins.getDataByTypeAndKindAndLevle(
                                    t,
                                    e,
                                    o + 1
                                );
                                return n ? ((this._military[t][e - 1] = n), n) : null;
                            }),
                            (e.prototype.getAttrByType = function() {
                                return this._battleAttrInfo.reset(), this._battleAttrInfo;
                            }),
                            (e.prototype.newDay = function() {}),
                            (e.prototype.getData = function() {
                                var t = {};
                                for (var e in this._military) {
                                    for (
                                        var o = this._military[e], n = [], i = 0; i < o.length; i++
                                    ) {
                                        n.push(o[i].id);
                                    }
                                    t[e] = n;
                                }
                                return t;
                            }),
                            (e.prototype.onGoldChanged = function() {
                                var t = l.BagMrg.ins.getCount(l.BagMrg.GOLD),
                                    e = !1;
                                for (var o in this._military) {
                                    for (var n = this._military[o], i = 0; i < n.length; i++) {
                                        var a = n[i];
                                        if (a && a.money <= t && !e) {
                                            e = !0;
                                            break;
                                        }
                                    }
                                }
                                return (
                                    this._redDotState != e &&
                                    ((this._redDotState = e),
                                        this.emit(r.InfoEvent.RedDotStateChanged),
                                        this._bind && this._bind.setRedDotState(this._redDotState)),
                                    !1
                                );
                            }),
                            (e.prototype.setBind = function(t) {
                                (this._bind = t), this._bind.setRedDotState(this._redDotState);
                            }),
                            Object.defineProperty(e.prototype, 'redDotState', {
                                get: function get() {
                                    return this._redDotState;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            e
                        );
                    })(s.AbsObject);
                (o.MilitaryMrg = u), console.log("end");
            module.exports =  e.exports;